<script setup>

import { computed } from "vue"

import { useCounterStore } from "../stores/counter"

const store = useCounterStore();

const nums = computed(()=>{
  return store.nums
})
const sum = computed(()=>{
  return store.sum
})

function change(){
  store.change_nums(10)
}

function reset(){
  store.$reset();
}

</script>

<template>
  <main>
    <h1>这是首页</h1>
    <p>这是状态管理器中的状态：{{ nums }}</p>
    <p>这是状态管理器中的状态：{{ sum }}</p>
    <input type="button" value="按钮" @click="change">
    <input type="button" value="重置窗台" @click="reset">
  </main>
</template>
